<?php
/* @var $this BannerController */
/* @var $model Banner */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'banner-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
    'htmlOptions'=>array('enctype'=>'multipart/form-data'),
)); ?>

	<p class="note">带<span class="required">*</span>的项目必填.</p>

	<?php echo $form->errorSummary($model); ?>
    
    <?php if(!empty($model->banner_imgpath)){?>
    <div class="row">
    <?php
		echo CHtml::image('./assets/upload/image/'.$model->banner_imgpath,
		          $model->banner_remark,
		          array('width'=>400,'height'=>120)
            ); 
    ?>
	</div>
    <?php   } ?>
    
	<div class="row">
		<?php echo $form->labelEx($model,'banner_imgpath'); ?>
		<?php //echo $form->textField($model,'banner_imgpath',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo CHtml::activeFileField($model,'banner_imgpath',array('size'=>60,'maxlength'=>255)); ?>  
		<?php echo $form->error($model,'banner_imgpath'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'banner_url'); ?>
		<?php echo $form->textField($model,'banner_url',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'banner_url'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'banner_remark'); ?>
		<?php echo $form->textField($model,'banner_remark',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'banner_remark'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? '创建' : '保存'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->